﻿#ifndef NEWCONRECT_H
#define NEWCONRECT_H

#include <QObject>
#include <QVariant>
//QT_NAMESPACE是Qt自己定义的命名空间
QT_BEGIN_NAMESPACE
class QHostInfo;
QT_END_NAMESPACE
class NewConRect : public QObject
{
    Q_OBJECT
public:
    NewConRect();
    static NewConRect* instance();
    bool isIpAddr(const QString &ip);

public slots:
     Q_INVOKABLE void onBtnConnectClicked(QString str_add,QString str_port);

protected slots:
    void lookUp(const QHostInfo &host);

signals:
    void conSuccessSig(QString str_ipadd,QString str_HostName);
    void conFailSig(QString str_ipadd,QString str_HostName);

private:
    QString HostName;
    QString address;
    qint16 port;

};

#endif // NEWCONRECT_H
